{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
{/block}
{block name="js"}
{include file="public/_validform"}
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script type="text/javascript">
    var ue = UE.getEditor('editor');

    upload_image('image','','476','267');
    upload_image('QRcode','','200','200');
    upload_image('appsimage','','200','200');
    $("[name='cid']").find("[value='{$data.cid ?$data.cid :$Request.param.addcid }']").attr("selected", true);

    var URL = {
        uploader: '{:url('Upload/image')}',
        swf:'__STATIC__/admin/uploadify/uploadify.swf',
        ROOT:'__PUBLIC__/uploads/image',
        del_url:'{:url('Ucase/delimage')}',
    }
</script>
{/block}
{block name="main"}
<div class="page-container">

    <form class="form form-horizontal" action="{:url(\''.\\think\\Request::instance()->controller().'/save')}" id="form" method="post">

        <table class="table table-border table-bordered table-bg table-style">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>

            <tbody>
            {include file="public:_navadd"}
            <tr>
                    <th>
                        <span class="c-red">*</span>案例名称：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="" datatype="*" name="title">
                    </td>
                </tr>

                <tr>
                    <th>
                        案例图：300*300
                    </th>
                    <td>
                        <div id="image_s"><img src="__PUBLIC__/uploads/{$data.image ?'image/'.$data.image: 'sm_300.jpg'}" width="300px" height="300px"/></div>
                        <input id="image_post" name="image" type="hidden" value="{$data.image ?? ''}"/>
                        <input name="old_image" type="hidden" value="{$data.image ?? ''}"/>
                        <input id="image" name="" type="file" multiple="true">
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>公众号：200*200
                    </th>
                    <td>
                        <div id="QRcode_s"><img src="__PUBLIC__/uploads/{$data.QRcode ?'image/'.$data.QRcode: 'sm_200.jpg'}" width="200px" height="200px"/></div>
                        <input id="QRcode_post" name="QRcode" type="hidden" value="{$data.QRcode ?? ''}"/>
                        <input name="old_QRcode" type="hidden" value="{$data.QRcode ?? ''}"/>
                        <input id="QRcode" name="image_upload" type="file" multiple="true">
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>小程序：200*200
                    </th>
                    <td>
                        <div id="appsimage_s"><img src="__PUBLIC__/uploads/{$data.appsimage ?'image/'.$data.appsimage: 'sm_200.jpg'}" width="200px" height="200px"/></div>
                        <input id="appsimage_post" name="appsimage" type="hidden" value="{$data.appsimage ?? ''}"/>
                        <input name="old_appsimage" type="hidden" value="{$data.appsimage ?? ''}"/>
                        <input id="appsimage" name="" type="file" multiple="true">
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>多图片：
                    </th>
                    <td>
                        <div id="s_s">
                            {volist name="data.images|default=''" id="vo"}
                            <div class="uploads-box">
                                <a href="__PUBLIC__/uploads/image/{$vo.image}" target="_blank" title="查看">
                                    <img class="uploads-img" src="__PUBLIC__/uploads/image/{$vo.image}">
                                </a>

                                <input name="images[]" value="{$vo.image}" type="hidden">

                                <a class="uploads-del" onclick="delfile(this,'{$vo.image}');" title="删除">
                                    <i class="Hui-iconfont">&#xe6e2;</i>
                                </a>
                            </div>
                            {/volist}
                        </div>

                        <div class="clear"></div>

                        <input id="s" name="duo" type="file" multiple="true">
                    </td>
                </tr>

                <tr>
                    <th>
                        链接：
                    </th>
                    <td>
                        <input type="url" class="input-text" value="{$data.url ?? ''}" placeholder="如：{:\\think\\Request::instance()->domain()}" name="url">
                    </td>
                </tr>

                <tr>
                    <th>
                        排序值：
                    </th>
                    <td>
                        <input type="number" class="input-text" value="{$data.sort ?? ''}" placeholder="" name="sort">
                        <div style="font-size: 14px;float: left;margin: 5px 0 0 0;">
                            <span class="c-red">*</span>  不填写, 默认排序为最高
                        </div>
                    </td>
                </tr>

                <tr>
                    <th>
                        关键词：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.key ?? ''}" placeholder="" id="keywords" name="key">
                    </td>
                </tr>

                <tr>
                    <th>
                        案例摘要：
                    </th>
                    <td class="textarea-valid">
                        <textarea name="miaoshu" cols="" rows="" class="input-text textarea" placeholder="说点什么...最少输入10个字符">{$data.miaoshu ?? ''}</textarea>
                    </td>
                </tr>

                <tr>
                    <th>
                        管理人：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.issue ?? ''}" placeholder="" id="author" name="issue">
                    </td>
                </tr>

                <tr>
                    <th>
                        案例内容：
                    </th>
                    <td>
                        <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                    </td>
                </tr>
            </tbody>

            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        {:token()}
                        <input type="hidden" value="{$data.id ?? ''}" name="id">
                        <input type="hidden" value="{$data.cid ?? $addcid}" name="cidold" />
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                        <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重置&nbsp;&nbsp;">
                        <!-- <button onClick="layer_close();" class="btn radius btn-default radius" type="button"> &nbsp;&nbsp;取消&nbsp;&nbsp;</button> -->
                    </td>
                </tr>
            </tfoot>

        </table>

    </form>

</div>
{/block}